//
//  BaseHttpModel.m
//  TBNetworking_Example
//
//  Created by apple on 2018/8/7.
//  Copyright © 2018年 lzb. All rights reserved.
//

#import "BaseHttpModel.h"
#import <objc/runtime.h>
#import "NSObject+ZBProperty.h"
#import "AFExtensionDataConversion.h"

@implementation BaseHttpModel

/**
  模型转字典
 */
- (NSDictionary *)modelToDictionary
{
    
    return [AFExtensionDataConversion JSONDictionaryFromModel:self];
}


- (void)setNilValueForKey:(NSString *)key
{
    NSString *propertyType = [self zb_getPropertyTypeWithPropertyName:key];
    if([propertyType isEqualToString:ZBPropertyTypeConstant]){
        [self setValue:@(0) forKey:key];
    }else{
        [super setNilValueForKey:key];
    }
}
@end
